package com.leps.nq.tx.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.leps.nq.bi.vo.SimpleEntry;
import com.leps.nq.tx.entity.ReadHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leps.nq.tx.vo.LiquidQueryModel;
import com.leps.nq.tx.vo.ReadHistoryVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hex
 * @since 2022-08-10
 */
@Mapper
public interface ReadHistoryMapper extends BaseMapper<ReadHistory> {

    List<ReadHistoryVo> selectLastReadHistoryByPumpId(int pumpId);

    Long selectLastSerialNumberByPlcId(int plcId);

    List<SimpleEntry<Double>> selectRecentLiquidLevels(int pumpId);

    ReadHistory selectLastLiquidByPumpId(int pumpId);

    Page<ReadHistory> pageLiquidByQueryModel(@Param("page") Page<ReadHistory> page, @Param("queryModel") LiquidQueryModel queryModel);
}
